/*   1:    */ package com.atomikos.beans;
/*   2:    */ 
/*   3:    */ import com.atomikos.swing.PropertiesTableModel;
/*   4:    */ import java.util.Vector;
/*   5:    */ import javax.swing.table.AbstractTableModel;
/*   6:    */ import javax.swing.table.TableModel;
/*   7:    */ 
/*   8:    */ class IndexedPropertyTableModel
/*   9:    */   extends AbstractTableModel
/*  10:    */   implements PropertiesTableModel
/*  11:    */ {
/*  12:    */   private Vector data_;
/*  13:    */   private String header_;
/*  14:    */   
/*  15:    */   IndexedPropertyTableModel(Vector data, String header)
/*  16:    */   {
/*  17: 51 */     this.data_ = data;
/*  18: 52 */     this.header_ = header;
/*  19:    */   }
/*  20:    */   
/*  21:    */   public TableModel getTableModel()
/*  22:    */   {
/*  23: 57 */     return this;
/*  24:    */   }
/*  25:    */   
/*  26:    */   public int getRowCount()
/*  27:    */   {
/*  28: 61 */     return this.data_.size();
/*  29:    */   }
/*  30:    */   
/*  31:    */   public int getColumnCount()
/*  32:    */   {
/*  33: 65 */     return 1;
/*  34:    */   }
/*  35:    */   
/*  36:    */   public Object getValueAt(int row, int column)
/*  37:    */   {
/*  38: 69 */     if (column > 0) {
/*  39: 70 */       throw new IllegalArgumentException("No such column");
/*  40:    */     }
/*  41: 72 */     return this.data_.elementAt(row);
/*  42:    */   }
/*  43:    */   
/*  44:    */   public String getColumnName(int col)
/*  45:    */   {
/*  46: 77 */     if (col != 0) {
/*  47: 78 */       throw new IllegalArgumentException("No such column");
/*  48:    */     }
/*  49: 80 */     return this.header_;
/*  50:    */   }
/*  51:    */   
/*  52:    */   public boolean isCellEditable(int row, int col)
/*  53:    */   {
/*  54: 85 */     return false;
/*  55:    */   }
/*  56:    */   
/*  57:    */   public void rowDeleted(int row)
/*  58:    */   {
/*  59: 90 */     fireTableRowsDeleted(row, row);
/*  60:    */   }
/*  61:    */   
/*  62:    */   public void refresh()
/*  63:    */   {
/*  64: 95 */     fireTableRowsUpdated(0, this.data_.size());
/*  65:    */   }
/*  66:    */   
/*  67:    */   public void rowInserted()
/*  68:    */   {
/*  69:100 */     fireTableRowsInserted(0, this.data_.size());
/*  70:    */   }
/*  71:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\atomikos-util\3.7.0\atomikos-util-3.7.0.jar
 * Qualified Name:     com.atomikos.beans.IndexedPropertyTableModel
 * JD-Core Version:    0.7.0.1
 */